{yun:}include file="$comstyle/header.htm"{/yun}
<div class="w1000">
	<div class="admin_mainbody"> 
		{yun:}include file="$comstyle/left.htm"{/yun} 
		<script src="{yun:}$config.sy_weburl{/yun}/js/ueditor/ueditor.config.js?v={yun:}$config.cachecode{/yun}"></script>
		<script src="{yun:}$config.sy_weburl{/yun}/js/ueditor/ueditor.all.min.js?v={yun:}$config.cachecode{/yun}"></script> 

 		<script language="javascript">
		UE.getEditor('description',{
			toolbars:[[ 'Source','|', 'Undo', 'Redo','Bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'fontfamily', 'fontsize',  'forecolor', 'backcolor', 'removeformat', 'autotypeset', 'pasteplain', '|','insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', '|','simpleupload', '|','link', 'unlink', 'indent', '|','justifyleft', 'justifycenter', 'justifyright', 'justifyjustify']],
			wordCount:false,
			elementPathEnabled:false,
			initialFrameHeight:300
		});
		</script>

		<div class=right_box>
			<div class=admincont_box>
				<div class="com_tit"><span class="com_tit_span">添加产品</span></div>
                <div class="job_list_tit">
                 <ul class="">
                 <li ><a href="index.php?c=info">基本信息</a></li>
                 <li><a href="index.php?c=map">企业地图</a></li>
                 <li><a href="index.php?c=news">企业新闻</a></li>
                 <li><a href="index.php?c=show">企业环境</a></li>
                 <li class="job_list_tit_cur"><a href="index.php?c=product">企业产品</a></li>
                 </ul>
                 </div>
				<div class="com_body">
					<div class="com_release_box">
						<iframe id="supportiframe"  name="supportiframe" onload="returnmessage('supportiframe');" style="display:none"></iframe>
						<form id="productform" name="MyForm" method="post" target="supportiframe" action="index.php?c=product&act=save">
							<ul>
								<li>
									<div class="com_release_name"><i class="ff0">*</i> 产品标题</div>
									<input type="text"  name="title" value="{yun:}$editrow.title{/yun}"class="com_info_text" style="width:200px;"  >
									<span id="by_name"  class="errordisplay">不能为空</span>
								</li>
								<li>
									<div class="com_release_name"><i class="ff0">*</i> 产品图片</div>
									<div class="add_product_text">
										<button type="button" class="yun_bth_pic adminupload" lay-data="{name: 'pic',imgid: 'imgicon',parentid: 'imgparent'}">上传图片</button> 最佳尺寸：宽/高=270像素/180像素<span id="by_name" class="errordisplay">不能为空</span>
										<input type="hidden" id="layupload_type" value="2"/>
										<input type="hidden" id="upload_path" value="product"/>
										<input type="hidden" name="pic" value=""/>
									</div>
								</li>
								<li id="imgparent" {yun:}if !$editrow.pic{/yun}class="none"{yun:}/if{/yun}>
									<div class="com_release_name"><i class="ff0">*</i> 图片展示</div>
									<img id="imgicon" src="{yun:}$config.sy_weburl{/yun}/{yun:}$editrow.pic{/yun}" width="100" height="60"/>
								</li>
								<li>
									<div class="com_release_name"><i class="ff0">*</i> 产品描述</div>
 									<script id="description" name="body" type="text/plain" style="width:560px; height:200px;"> {yun:}$editrow.body{/yun} </script>
									<span id="by_description" class="errordisplay">不能为空</span>
								</li>   
								<li>
									<input name="id" value="{yun:}$smarty.get.id{/yun}" type="hidden"/>
									<input class="btn_01" type="button" onclick="CheckPost()" value="提交操作">  
								</li> 
							</ul>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<script src="{yun:}$config.sy_weburl{/yun}/js/layui.upload.js?v={yun:}$config.cachecode{/yun}" type='text/javascript'></script> 
<script language="javascript">
function CheckPost(){ 
	var title=$.trim($("input[name='title']").val());
	if(title==''){
		layer.msg('产品标题不能为空！', 2, 8);return false;
	}
	if(title.lentgh>30){
		layer.msg('请将标题控制在30字以内！', 2, 8);return false;
	}
	if($.trim($("input[name='pic']").val())=='' && $.trim($("input[name='id']").val())==''){
		layer.msg('产品图片不能为空！', 2, 8);return false;
	}
	if(UE.getEditor('description').getContent()==''){
		layer.msg('产品描述不能为空！', 2, 8);return false;
	}  
	$("#productform").submit();
	layer.load('执行中，请稍候...',0);
}
</script> 
{yun:}include file="$comstyle/footer.htm"{/yun}